package com.usian.user.controller;

import com.usian.model.media.pojos.WmUser;
import com.usian.user.feign.WemediaFeign;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test/v1")
public class TestController {

    @Autowired
    private WemediaFeign wemediaFeign;

    @GetMapping("/{name}")
    public String test1(@PathVariable String name){
        WmUser wmUser = wemediaFeign.findByName(name);
        System.out.println(wmUser.getName());
        return wmUser.getName();
    }


}
